﻿using MySqlConnector;

namespace Front._1117._1124;

public partial class login : Form
{
    public login()
    {
        InitializeComponent();
    }

    private void button1_Click(object sender, EventArgs e)
    {
        Console.OutputEncoding = System.Text.Encoding.UTF8;
        Console.InputEncoding = System.Text.Encoding.UTF8;
        using var connection = new MySqlConnection("server=localhost;port=3306;database=book;user=root;password=Sun015492;charset=utf8mb4;AllowPublicKeyRetrieval=True;");
        connection.Open();

        using var command = new MySqlCommand("SELECT* FROM book_info;", connection);
        using var reader = command.ExecuteReader();
        while (reader.Read())
            Console.WriteLine(reader.GetString(2));
    }
}